import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang3.RandomUtils;
import org.jeecg.common.api.ding.DingApi;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.modules.dinguser.service.IDiyDingUserService;
import org.jeecg.modules.entity.DiyTableStatus;
import org.jeecg.modules.service.impl.DiyTableStatusServiceImpl;
import org.jeecg.modules.service.impl.ProjectOwnProfessorServiceImpl;
import org.jeecg.modules.smartStudent.entity.SmartStudentTeacherInfomation;
import org.jeecg.modules.smartStudent.mapper.SmartStudentTeacherInfomationMapper;
import org.jeecg.modules.vo.ProjectOwnProfessor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = SampleOapiProcessinstanceCreateRequest2.class)
public class SampleOapiProcessinstanceCreateRequest2 {
    @Resource
    private SmartStudentTeacherInfomationMapper smartStudentTeacherInfomationMapper;

    @Test
    public void testCommonJwtUtil(){
        String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1OTA2MzMzNDEsInVzZXJuYW1lIjoiYWRtaW4ifQ.SZ_HMiYtVt48qMUOAF6rQ7k7YYtfPbMmXLO2B_AsRxk";
        System.out.println(JwtUtil.getUsername(token));
    }
    @Test
    public void random(){
        int i =100;
        while (i>0) {
            int random = RandomUtils.nextInt(0, 2);
            System.out.println(random);
            i--;
        }
    }
    @Test
    public void duobioa(){
//        ProjectOwnProfessorServiceImpl projectOwnProfessorService = new ProjectOwnProfessorServiceImpl();
//        Page<ProjectOwnProfessor> page = new Page<>(1, 2);
//        List<ProjectOwnProfessor> projectOwnProfessors = projectOwnProfessorService.queryPage(page);
//        System.out.println(projectOwnProfessors);
        DiyTableStatusServiceImpl diyTableStatusService = new DiyTableStatusServiceImpl();
        Page<DiyTableStatus> page = new Page<>(1, 2);
        diyTableStatusService.queryPage(page,new DiyTableStatus());
    }

    @Test
    public void t2(){
        x("1","2");
    }

    public static void x(String ...x){
        System.out.println(x);
    }



    @Test
    public void testSaveDingUser(){
        SmartStudentTeacherInfomation s = new SmartStudentTeacherInfomation();
        s.setId("100");
        s.setCreateBy("");
        s.setCreateTime(null);
        s.setUpdateTime(null);
        s.setSysOrgCode(null);
        s.setStudentName("假人");
        s.setStudentStudentNumber("18205611");
        s.setStudentSex("男");
        s.setStudentDempartment("计算机工程系");
        s.setStudentMajor("软件工程");
        s.setStudentTimeEnrollment("2018");
        s.setStudentPhoneNumber("12345678900");
        s.setStudentStanbdy(null);
        s.setStudentStanbdyStanbdy(null);
        smartStudentTeacherInfomationMapper.insertInfomatiron(s);

//        for(int i=0;i<100;i++){
//            SmartStudentTeacherInfomation s = new SmartStudentTeacherInfomation();
//            s.setId("100"+i);
//            s.setCreateBy("");
//            s.setCreateTime(null);
//            s.setUpdateTime(null);
//            s.setSysOrgCode(null);
//            s.setStudentName("假人"+i);
//            s.setStudentStudentNumber("18205611"+i);
//            s.setStudentSex("男");
//            s.setStudentDempartment("计算机工程系");
//            s.setStudentMajor("软件工程");
//            s.setStudentTimeEnrollment("2018");
//            s.setStudentPhoneNumber("12345678900");
//            s.setStudentStanbdy(null);
//            s.setStudentStanbdyStanbdy(null);
//            smartStudentTeacherInfomationMapper.insertInfomatiron(s);
//        }
    }
}
